﻿<ResourceDictionary 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:graph="clr-namespace:zeal.ui.graph">
    
    <!-- Background brush -->
    <DrawingBrush x:Key="GraphBackgroundBrush" Viewport="0,0,20,20" ViewportUnits="Absolute" TileMode="Tile">
        <DrawingBrush.Drawing>
            <GeometryDrawing Brush="#FF595959">
                <GeometryDrawing.Geometry>
                    <RectangleGeometry Rect="0,0,0.6,0.6"/>
                </GeometryDrawing.Geometry>
                <GeometryDrawing.Pen>
                    <Pen Thickness="0.005" Brush="#FF838383"/>
                </GeometryDrawing.Pen>
            </GeometryDrawing>
        </DrawingBrush.Drawing>
    </DrawingBrush>
    
    <!-- Tooltip -->
    <ControlTemplate x:Key="ConnectErrorTooltipTemplate">
        <Border Width="200" CornerRadius="4">
            <Border.Background>
                <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
                    <GradientStop Color="#FFFFFFFF" Offset="0" />
                    <GradientStop Color="#FFE5E5E5" Offset="1" />
                </LinearGradientBrush>
            </Border.Background>
            <Border.Effect>
                <DropShadowEffect BlurRadius="15" Opacity="1" Direction="300" RenderingBias="Performance" />
            </Border.Effect>
            <TextBlock Text="{Binding errorMessage}" TextWrapping="Wrap" TextOptions.TextFormattingMode="Display" Margin="5"/>
        </Border>
    </ControlTemplate>
    
    <!-- GraphViewer -->
    <Style TargetType="{x:Type graph:GraphViewer}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type graph:GraphViewer}">
                    <Grid Background="White">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="*" />
                            <RowDefinition Height="Auto" />
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="Auto" />
                        </Grid.ColumnDefinitions>
                        <ContentPresenter />
                        <ScrollBar Name="PART_horizontal" Grid.Row="1" Orientation="Horizontal" />
                        <ScrollBar Name="PART_vertical" Grid.Column="1" Orientation="Vertical" />
                        <DockPanel Grid.Row="1" Grid.Column="1" Background="#FF3D3D3D"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>